package Game.Battle;

import Game.Players.Player;
import Game.Players.Units.*;

import java.util.Scanner;

public class Battle {
    public static void main(String args[]) {

        Player p1 = new Player();
        Player p2 = new Player();

        System.out.println("The Battle is started!");

        System.out.println("Player 1 selects unit: ");
        p1.selectUnit();
        System.out.println(p1.creature.getName() + " was selected");

        System.out.println("Player 2 selects unit: ");
        p2.selectUnit();
        System.out.println(p2.creature.getName() + " was selected");

        if (p1.creature.getLevel() < p2.creature.getLevel()) {
            System.out.println("Player 1 can create squad");
            int lvldiff = p2.creature.getLevel() - p1.creature.getLevel();
            p1.creature.setSquadSize(Player.createSquad(lvldiff));
        } else if(p1.creature.getLevel() > p2.creature.getLevel()) {
            System.out.println("Player 2 can create squad");
            int lvldiff = p1.creature.getLevel() - p2.creature.getLevel();
            p2.creature.setSquadSize(Player.createSquad(lvldiff));
        }

        /*round iterator should start here

        */
       /* while (p1.creature.getHealth() > 0 && p2.creature.getHealth() > 0) {//turn iterator

            System.out.println("Player1 turn");
            p1.attack(p1.creature, p2.creature);
            if (p2.creature.getHealth() > 0) {//теперь мёртвый второй не сможет походить в последний раз
                System.out.println("Player2 turn");
                p2.attack(p2.creature, p1.creature);
            }
             }*/
        System.out.println("Player 1: " + p1.creature.getName() + " hp: " + p1.creature.getHealth() + " lvl: " + p1.creature.getLevel());
        System.out.println("Player 2: " + p2.creature.getName() + " hp: " + p2.creature.getHealth() + " lvl: " + p2.creature.getLevel());

    }
}